package com.tool.shardingjdbc.config;

import java.util.Properties;
import org.apache.shardingsphere.spi.keygen.ShardingKeyGenerator;

/**
 * @description: 自定义keygenrator
 * @author: weirui
 * @create: 2020-07-28 16:07
 **/
public class PrimaryKeyGenerator implements ShardingKeyGenerator {

    public Comparable<?> generateKey() {
        Long key = System.currentTimeMillis();
        return key;
    }

    public String getType() {
        return "PRIMARY_KEY";
    }

    public Properties getProperties() {
        return null;
    }

    public void setProperties(Properties properties) {

    }
}
